package com.tlias.coutroller;

import com.tlias.entity.*;
import com.tlias.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    //员工性别统计
    @GetMapping("/empGenderData")
    public Result empGenderData(){
        List<EmpGenderCount> empGenderCountList = reportService.empGenderData();
        return Result.success(empGenderCountList);
    }
    //学员学历统计
    @GetMapping("/studentDegreeData")
    public Result studentDegreeData(){
        List<StudentAcademicCount> studentAcademicCountList = reportService.studentDegreeData();
        return Result.success(studentAcademicCountList);
    }
    //员工职位人数统计
    @GetMapping("/empJobData")
    public Result empJobData(){
        // 【修改】确认接收的是单个 EmpJobDataCount 对象
        EmpJobDataCount jobData = reportService.empJobData();
        return Result.success(jobData);
    }
    //班级人数统计
    @GetMapping("/studentCountData")
    public Result studentData(){
        // 【修改】确认接收的是单个 ClazzStudentCount 集合
        ClazzStudentCount clazzStudentList = reportService.studentCountData();
        return Result.success(clazzStudentList);
    }
}
